package com.tyylab.kestrel.framework.core.model.anno.params;

import lombok.Data;

@Data
public class MVCParams<T> {
    private Class<T> type;

    private String name;

    /**
     * @see org.springframework.web.bind.annotation.CookieValue
     * @see org.springframework.web.bind.annotation.MatrixVariable
     * @see org.springframework.web.bind.annotation.PathVariable
     * @see org.springframework.web.bind.annotation.RequestAttribute
     * @see org.springframework.web.bind.annotation.RequestBody
     * @see org.springframework.web.bind.annotation.RequestHeader
     * @see org.springframework.web.bind.annotation.RequestParam
     * @see org.springframework.web.bind.annotation.RequestPart
     */
    private MVCParamSource source = MVCParamSource.PARAM;

    private boolean required = true;

    private String def;

    public MVCParams(Class<T> type, String name) {
        this.type = type;
        this.name = name;
    }

    public MVCParams(Class<T> type, String name, MVCParamSource source) {
        this.type = type;
        this.name = name;
        this.source = source;
    }

    public MVCParams(Class<T> type, String name, MVCParamSource source, String def ) {
        this.type = type;
        this.name = name;
        this.source = source;
        this.def = def;
    }

    public MVCParams(Class<T> type, String name, String def ) {
        this.type = type;
        this.name = name;
        this.def = def;
    }
}
